/**
 * Promise三种状态
 * - pending
 * - fulfilled
 * - rejected
 * @type {Promise<unknown>}
 */
const promise = new Promise((resolve, reject) => {
  //立即执行部分，处于pending状态
  resolve(1)
  console.log(111)
})
  .then((res) => {
    //调用resolve后执行,处于fulfilled状态
    console.log(res)
  })
  .catch((err) => {
    //调用reject后执行，处于rejected状态
    console.log(err)
  })
  .then((res) => {
    console.log('===' + res)
  })
